package com.gaara.ddp;

import org.loon.framework.android.game.core.LSystem;
import org.loon.framework.android.game.core.graphics.LImage;
import org.loon.framework.android.game.core.graphics.Screen;
import org.loon.framework.android.game.core.graphics.Touch;
import org.loon.framework.android.game.core.graphics.device.LGraphics;
import org.loon.framework.android.game.core.graphics.window.LButton;
import org.loon.framework.android.game.core.timer.LTimerContext;

public class TitleScreen extends Screen {

	LButton setBtn,exitBtn;
	Boolean init = false;
	
	@Override
	public void onLoaded() {
		LImage img = new LImage("res/titleBack.png");
		setBackground(img);
	}

	
	@Override
	public void alter(LTimerContext timer) {
		if(!init){
			init = true;
			
			setBtn = new LButton("res/setBtn.png", 122, 122) {
				@Override
				public void doClick() {

				}
			};
			setBtn.setLocation(10, 330);
			setBtn.setEnabled(true);
			add(setBtn);
			
			exitBtn = new LButton("res/exitBtn.png", 106, 106) {
				@Override
				public void doClick() {
					LSystem.exit();
				}
			};
			exitBtn.setLocation(LSystem.MAX_SCREEN_WIDTH-exitBtn.getWidth()-50, 340);
			exitBtn.setEnabled(true);
			add(exitBtn);
 		}
		
		
	}
	
	@Override
	public void draw(LGraphics arg0) {
		// TODO Auto-generated method stub

	}

	@Override
	public void onTouchDown(Touch arg0) {
		// TODO Auto-generated method stub

	}

	@Override
	public void onTouchMove(Touch arg0) {
		// TODO Auto-generated method stub

	}

	@Override
	public void onTouchUp(Touch arg0) {
		// TODO Auto-generated method stub

	}

}
